﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ProcessPay</title>
</head>
<body>

    <script type="text/javascript">
        //获取共享地址
        function editAddress()
        {
            WeixinJSBridge.invoke(
                'editAddress',
                @Html.Raw(ViewBag.wxEditAddrParam),//josn串
                  function (res)
                  {
                      var addr1 = res.proviceFirstStageName;
                      var addr2 = res.addressCitySecondStageName;
                      var addr3 = res.addressCountiesThirdStageName;
                      var addr4 = res.addressDetailInfo;
                      var tel = res.telNumber;
                      var addr = addr1 + addr2 + addr3 + addr4;
                      alert(addr + ":" + tel);
                  }
              );
        }

        window.onload = function ()
        {
            if (typeof WeixinJSBridge == "undefined")
            {
                if (document.addEventListener)
                {
                    document.addEventListener('WeixinJSBridgeReady', editAddress, false);
                }
                else if (document.attachEvent)
                {
                    document.attachEvent('WeixinJSBridgeReady', editAddress);
                    document.attachEvent('onWeixinJSBridgeReady', editAddress);
                }
            }
            else
            {
                editAddress();
            }
        };
        function TowxPay2(){ 
            var amount='@ViewBag.amount';
            var openid='@ViewBag.openid'; 
            alert(amount)
            window.location.href='/WechatPay/wxPay2?amount='+amount+'&openid='+openid;
        }
        TowxPay2();
    </script>
    <div>
        <a style="color:red;">正在加载...</a>
    </div>
</body>
</html>
